package com.itheima.controller;


import com.itheima.DeptService.DeptService;
import com.itheima.DeptService.impl.DeptServiceimpl;
import com.itheima.pojo.DeptBean;
import com.itheima.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class Deptcontrol  {
    @Autowired
    private DeptService deptService;
    @GetMapping("/depts")
    public Result List2() {
        List<DeptBean> deptlist = deptService.List();
        return Result.success(deptlist);
    }
}
